<!DOCTYPE html>
<html>
  <head>
    <title>treatInfoIframe.html</title>
	
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->

  </head>
  <style type="text/css">
    body {
        width: 100%;
        height: 100%;
        background: #fff;
    }
    /*表格样式*/
  
</style>
  <link rel="stylesheet" href="/Hospital/lib/layui-v2.1.6/layui/css/layui.css" media="all">
  <body>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>治疗信息查看</legend>
    </fieldset>
    <table id="treatInfoTable" class="layui-table"  lay-filter="listen"></table>
    
  </body>
<script src="/Hospital/lib/jquery.min.js" charset="utf-8"></script>
<script src="/Hospital/lib/layui-v2.1.6/layui/layui.js" charset="utf-8"></script>
<script type="text/html" id="bar">
	<a class="layui-btn layui-btn-mini" lay-event="detail">详情</a>
</script>
<script>
	layui.use(['table'],function(){
		var table = layui.table;
		var $ = layui.jquery;
		initTable();
		listen();
		function initTable(){
			var height=window.innerHeight*0.8;
            var tableWidth=window.innerWidth*0.13;
            var clientId=JSON.parse(localStorage.getItem("treatInfoClientId"));
            localStorage.removeItem("treatInfoClientId");
            table.render({
            	id:"treatInfoTable",
                elem:"#treatInfoTable",
                page:true,
                limit:10,
                center:true,
                height:height,
                cols:[[
					{field:'clinicName',width:tableWidth,title:'所属门诊',align:'center'},
                    {field:'clientName',width:tableWidth,title:'姓名',align:'center'},
                    {field:'projectName',width:tableWidth,title:'治疗项目',sort:true,align:'center'},
                    {field:'excutorName',width:tableWidth,title:'执行医生',align:'center'},
                    {field:'excutorCode',width:tableWidth,title:'执行医生工号',sort:true,align:'center'},
                    {field:'departmentName',width:tableWidth,title:'所属科室',align:'center'},
                    {field:'unitPrice',width:tableWidth,title:'治疗价格/次',align:'center'},
                    {field:'treatTime',width:tableWidth,title:'治疗日期',sort:true,align:'center',fixed: 'right'},
                    {fixed:'right',width:70,align:'center',toolbar:'#bar'}
                ]],
                url:"/Hospital/medicalCardController/getClientTreatInfo",
                method:"POST",
                where:clientId,
                response:{
                	statusName:"code",
                	statusCode:200,
                	countName:'total',
                	msgName:"msg",
                	dataName:"result"
                }
            });
		}
		function listen(){
			table.on('tool(listen)',function(obj){
				var data = obj.data;
				var layEvent = obj.event;
				if(layEvent == 'detail'){
					layer.msg("<ul><li>执行总次数："+data.totalNumber+"</li><li>剩余次数："+data.restNumber+"</li><li>开始时间："+data.startTime+"</li><li>截止时间："+data.deadline+"</li></ul>",{
						time : false,
						btn : ['确定'],
						btnAlign : 'c'
					});
				}
			});
		}
	});
</script>
</html>
